var request = require('./request.js');
/**
 *  物流详情
 */
function expressDetailAction(orderid){
  return new Promise((resoleve, reject) => {
    var url =  'https://api.hongheyu1688.com/express/info';
    // var url = 'http://192.168.1.88:8082/express/info';
    // var url = 'http://114.80.200.31:8081/express/info';
    var token = wx.getStorageSync('token');
    var params = {
      orderId: orderid,
      token: token
    }
    var self = this;
    request.requestPost(url, params)
      .then(data => {
        // self.setData({
        //   expressStr: JSON.stringify(data),
        //   expressDetail: JSON.parse(data.detail),
        //   expressCompany: data.company
        // })
        // console.log(self.data);
        resoleve(data);
      }).catch(msg => {
        reject(msg);
      });
  });
}

module.exports = {
  expressDetailAction: expressDetailAction
}
